<template>
    <div class="list">
      <goodsname
        v-for="(item,i) in goodsList"
        :key="i"
        :goodsinfo="item"
      ></goodsname>
    </div>
</template>

<script>
import goodsname from '@/components/goods-list/goodsname'
import { getgoods } from '@/api/goods'
export default {
  data () {
    return {
      goodsList: []
    }
  },
  props: {
    shopleiid: {
      type: Number,
      required: true
    }
  },
  created () {
    this.loadgoods()
  },
  mounted () {

  },
  components: {
    goodsname
  },
  methods: {
    async loadgoods() {
      const res = await getgoods({
        pageNum: 1,
        pageSize: 100,
        shop_id: this.$route.params.shopId,
        goods_type_id: this.shopleiid
      })
      this.goodsList = res.data.data.rows
    }
  }
}
</script>

<style scoped lang="less">
.list {
  height: 70vh;
  overflow-y: auto;
  overflow-x:hidden;
  margin-top: 20px;
  padding: 0 20px;
}

</style>
